﻿// This code is released under the BSD license.
namespace PugLib.Benchmarks
{
    using System;
    using Math;

    public static class Maths
    {
        public static TestResult PythagoreanSerial()
        {
            Console.WriteLine("PythagoreanSerial");
            TestResult trd = new TestResult("PythagoreanSerial");

            trd.Start();
            PythagoreanTuples.GetPythagoreanTuplesInRangeSerial(0, Statics.PythagoreanMax);
            trd.Stop();

            return trd;
        }

        public static TestResult PythagoreanParallelOuter()
        {
            Console.WriteLine("PythagoreanParallelOuter");
            TestResult trd = new TestResult("PythagoreanParallelOuter");

            trd.Start();
            PythagoreanTuples.GetPythagoreanTuplesInRangeOuterParallel(0, Statics.PythagoreanMax);
            trd.Stop();

            return trd;
        }

        public static TestResult PythagoreanParallelOuterAndMiddle()
        {
            Console.WriteLine("PythagoreanParallelOuterAndMiddle");
            TestResult trd = new TestResult("PythagoreanParallelOuterAndMiddle");

            trd.Start();
            PythagoreanTuples.GetPythagoreanTuplesInRangeOuterAndMiddleParallel(0, Statics.PythagoreanMax);
            trd.Stop();

            return trd;
        }
    }
}